class Pagination {
    constructor(pageBoxId, currentPage, limit, total) {
        this.pageBoxId = pageBoxId
        this.currentPage = currentPage
        this.limit = limit
        this.total = total
    }

    // 初始化分页
    init() {
        var pagerHtml = `
            <div class="mar-r-10 font-12 color-666 text-nowrap">
                <span>共</span>
                <span id="total">${this.total}</span>
                <span>条</span>
            </div>

            <div class="mar-r-10 font-12 color-666">
                <select id="fenye" class="fenye" onchange="handleChangePage(event)"></select>
            </div>

            <div class="flex align-center mar-r-10 font-12" id="yema">
            </div>

            <div class="font-12 color-666 text-nowrap">
                <span>前往</span>
                <input type="text" class="w-px-30 fenye text-center" id="pageInput" />
                <span>页</span>
            </div>
        `

        let box = document.getElementById(this.pageBoxId)

        box.innerHTML = pagerHtml
    }

}

